home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 02 / 8 / DISK0283.ZIP / KWSEARCH.DOC < prev    next >
Text File  |  1985-01-31  |  13KB  |  364 lines

  1.        ++++++++++++++++++++++++++++++++++++++++++++++++++++
  2.  
  3.        DOCUMENTATION FOR KWSEARCH version 1.3, January 1985
  4.  
  5.        ++++++++++++++++++++++++++++++++++++++++++++++++++++
  6.  
  7.  
  8. If you have a printer, you may prefer to print this documentation
  9. instead of viewing it on the screen.  If you are using IBM-DOS,
  10. you can print this file by returning to DOS, and then typing the
  11. command,   
  12.  
  13.                    COPY KWSEARCH.DOC LPT1:
  14.  
  15. Alternatively, if you have an ASCII compatible word processor,
  16. you could use it to format and print this file.
  17.  
  18.  
  19. Before You Use KWSEARCH
  20. -----------------------
  21.  
  22. You should have a diskette with your "system" in drive A while
  23. running this program.  This can be accomplished by formatting a
  24. new diskette with the /s option (see your DOS manual), copying
  25. KWSEARCH.EXE to that diskette, and then using it in drive A.
  26.  
  27.  
  28. NOTE: The symbol which you see at the end of paragraphs if you
  29.       view this file on your screen is an unprintable word
  30.       processor control character. 
  31.  
  32.  
  33.  
  34. What KWSEARCH Does
  35. ------------------
  36.  
  37. KWSEARCH reads text from one or more "source files", and
  38. transfers those "records" matching your "search criteria" to a
  39. "destination file".  A "record" can be thought of as simply a
  40. paragraph. 
  41.  
  42.  
  43.     Source File                                  Destination File
  44.    +------------+                                +--------------+
  45.    |            |                                |              |
  46.    | "Records"  |                                |   Records    |
  47.    |            |                                |   Matching   |
  48.    |            |    ----->  KWSEARCH  ----->    |    Search    |
  49.    |            |                                |   Criteria   |
  50.    |            |                                |              |
  51.    +------------+                                +--------------+
  52.  
  53.  
  54.  
  55.  
  56. Advantages of KWSEARCH
  57. ----------------------
  58.  
  59. KWSEARCH searches regular sequential text files for records and
  60. key words.  No key or index files are used and no "importing" of
  61. text files is necessary before performing a search, as long as
  62. the file is in ASCII format.  This allows efficient use of disk
  63. space and lets you conduct searches on files that would not
  64. otherwise be useable as databases.
  65.  
  66.  
  67. Source Files
  68. ------------
  69.  
  70. The source files contain the text which you wish to search.  They
  71. can be any regular text files in ASCII format, created with your
  72. word processor, downloaded through a modem, or generated by
  73. another program.  Many word processing programs store files in
  74. this format, and those which do not generally have utility
  75. programs for conversion into ASCII format.
  76.  
  77. To determine if a file is in this format, you could use the DOS
  78. command, TYPE filename.  If the resulting screen output consists
  79. of normal, legible text, then the file is an ASCII file.  The
  80. file you are reading now is an ASCII file.
  81.  
  82. You can search up to 10 source files during a single run.  Simply
  83. enter the names of the files when prompted.  You can use the disk
  84. drive prefixes A:, B:, etc. to specify files but subdirectory and
  85. path parameters (.. and \) are not recognized by this version of
  86. KWSEARCH.  Therefore, if you have files organized into
  87. subdirectories, all referenced files must be in the default
  88. subdirectory of each drive.
  89.  
  90.  
  91. Records
  92. -------
  93.  
  94. A record is the basic unit of related information read by
  95. KWSEARCH from a source file.  Most database management programs
  96. break a record down into fields, and require that a certain
  97. amount of disk space be set aside for each field, whether that
  98. space is used or not.  Some programs have pre-defined limits on
  99. field structure and field size.  Others require that you define
  100. the fields and their sizes for each database.
  101.  
  102. KWSEARCH is much simpler.  It recognizes a record as a series of
  103. up to 50 lines of text, separated from other records by a blank
  104. line.  Therefore a record is like a paragraph.  In fact, you can
  105. use KWSEARCH to search for paragraphs in a document as if they
  106. were records in a database.
  107.  
  108. Key word lines are the only part of a record that are analogous
  109. to fields, and they are optional.  However, restricting a search
  110. to words on key word lines makes the search run faster.  In
  111. either case, if a records' key words match the search criteria,
  112. the entire record will be copied to the destination file, up to a
  113. maximum of 50 lines per record.
  114.  
  115. If a record contains more than 50 lines, or more than 600 key
  116. words, then the record is broken at that point and subsequent
  117. lines are treated like another record.
  118.  
  119. The default definition of a key word line is any line beginning
  120. with the characters "KW:".  There can be up to 10 key word lines
  121. in a record.  All words on the key word lines in a record will be
  122. compared with the search criteria to determine if the record is
  123. to be saved.
  124.  
  125. You can redefine the identifier for your key word lines (e.g.
  126. lines beginning with KEY:) or you can search the full text.
  127. For this option, records must contain no more than 600 words
  128. each.
  129.  
  130.  
  131. Search Criteria
  132. ---------------
  133.  
  134. The search criteria describe the conditions which must be met by
  135. a record in order for it to be saved.  It consists of three types
  136. of information, 
  137.  
  138. 1) up to 10 key words, 
  139.  
  140. 2) a combination of those key words using the operators AND, OR,
  141.    and NOT, 
  142.  
  143. 3) instructions as to which lines in a record which will be used
  144.    as key word lines.
  145.  
  146. The last "search set" defined will be the one used as the basis
  147. for a search, although search statistics will be listed for all
  148. other key words and search sets.
  149.  
  150. The best method of defining search criteria depends on the nature
  151. of your source files and on your information retrieval
  152. requirements.  An example of a search for a recipe is used for
  153. illustration.
  154.  
  155.  
  156. Here are two sample records...
  157.  
  158.  
  159. Guacamole
  160. ---------
  161. 2 medium avocados
  162. 2 T. lemon juice
  163. 1/4 t. pepper
  164. 1/2 small onion, chopped
  165. 1 clove garlic, minced
  166. 1/2 t. salt
  167. ...
  168. Mix in a blender until smooth.  Makes 1 and 1/4 cups.
  169. KW: GUACAMOLE, AVOCADOS, GARLIC, ONION, MEXICAN
  170.  
  171. Enchilada Sauce
  172. ---------------
  173. 1 pound fresh ripe tomatoes
  174. 1 large red bell pepper
  175. 2 med. red onions
  176. 2 large cloves garlic
  177. 1/2 t salt
  178. 1/2 t crushed red pepper
  179. 1/4 t cumin
  180. 1/4 t black pepper
  181. ...
  182. Cut tomatoes, peppers, and onion into small chunks.  Combine in a
  183. blender and puree.
  184. KW: ENCHILADA SAUCE, TOMATOES, ONIONS, GARLIC, MEXICAN
  185.  
  186.  
  187. Now, suppose you want to search for all recipes that contain the
  188. key words AVOCADO or TOMATO.  Run KWSEARCH, specify AVOCADO and
  189. TOMATO as key words, then combine those key words with OR.
  190. Lastly, specify the names of the source and a destination files.
  191. When the search begins, the following will occur:
  192.  
  193.      KWSEARCH will read the guacamole recipe and will recognize
  194.      the words on the line beginning with "KW:" as the record's
  195.      key words.  It will then compare those key words with the
  196.      search criteria.  Since they meet the search criteria, the
  197.      recipe will be copied to the destination file.  Then the
  198.      next recipe will be saved as well since its key words also
  199.      match the search criteria.
  200.  
  201.  
  202. You have the option to print descriptive information in the
  203. destination file along with the records themselves.  Descriptive
  204. information includes the date, starting time of the search, names
  205. of source files, search criteria, and finishing time.
  206.  
  207.  
  208. In version 1.3 of KWSEARCH, the following rules apply:
  209.  
  210. 1. Key words can be either upper or lower case in the source
  211.    files and you can enter the search criteria in either upper
  212.    or lower case.
  213.  
  214. 2. Key words in a record are truncated to the length of the
  215.    search criterion word before a comparison is made.  Therefore,
  216.    if you are searching for AVOCADO, you will find AVOCADOES.  It
  217.    is recommended that you specify the roots of words as search
  218.    criteria, for example, use GEO in order to be able to detect
  219.    both GEOLOGY and GEOCHEMISTRY.  Note that comparisons are made
  220.    in a left justified field based on the length of the search
  221.    criterion word.
  222.  
  223.    The search criterion word, GEO, is contained in each of the
  224.    following source file words:
  225.  
  226.                             GEOLOGY,
  227.                        and  GEOCHEMISTRY
  228.  
  229.    However, if the search criterion word is CHEMISTRY, then
  230.    GEOCHEMISTRY does not match.  
  231.  
  232.  
  233. There are two types of "errors" that can occur when conducting a
  234. search: 
  235.  
  236. 1) failure to save a record that you would like to have saved,
  237.    and 
  238.  
  239. 2) saving a record that was not really desired.
  240.  
  241. Errors 1 and 2 can be minimized by carefully selecting the key
  242. words for defining records and for conducting a search.  Error 1
  243. can also be reduced by searching the full text instead of just
  244. key word lines although this results in slower program
  245. execution.
  246.  
  247. The approach you use to minimize these errors also depends on
  248. the time required for a search, and the time required to manually
  249. edit the destination file.
  250.  
  251. Careful assignment of key words can allow you to conduct
  252. effective searches that are moderately fast.  A way to ensure
  253. that a desired record is found is to use consisistency or
  254. redundancy when assigning key words to a record.  For example,
  255. you can assign the words GEO and CHEMISTRY, or GEOCHEMISTRY and
  256. CHEMISTRY instead of the single word GEOCHEMISTRY.  Similarly,
  257. you could specify (GEO OR CHEM) as part of the search criteria.
  258.  
  259. If execution time is a factor, it is more efficient to limit your
  260. search to words on key word lines and specify more words in the
  261. search criteria, than to search the full text.  However, it may
  262. be desirable to search the full text in order to make sure that
  263. no records are missed, or it may be necessary to do so if special
  264. key word lines are not present in the source file.
  265.  
  266. One tactic for effective searching is to divide it into stages.
  267. In the first stage, conduct an "inflated" search to make sure all
  268. possible records of interest are saved.  This can be accomplished
  269. by specifying lots of key words and combining them with OR's.
  270. You can then browse through this file before using it as the
  271. source file for more selective searches.
  272.  
  273.  
  274. The sequence of defining search criteria might be as follows:
  275.  
  276. Key Word 1 = ? <AVOCADO>
  277.  
  278. Key Word 2 = ? <TOMATO>
  279.  
  280. Key Word 3 = ? <ONIONS>
  281.  
  282. Key Word 4 = ? <GARLIC>
  283.  
  284.  
  285. Are the search words correct?  (Y or N)  <y>
  286.  
  287.  
  288. SET 5 = ? <1>                    ...1 represents AVOCADO.
  289.  
  290. SET 5 = AVOCADO ? <o>            ...o represents OR.
  291.  
  292. SET 5 = AVOCADO OR ? <2>         ...2 represents TOMATO.
  293.  
  294. SET 5 = (AVOCADO OR TOMATO)      ...  Set 5 is now defined.
  295.  
  296. SET 6 = ? <3>                    ...3 represents ONIONS.
  297.  
  298. SET 6 = ONIONS ? <o>             ...o represents OR.
  299.  
  300. SET 6 = ONIONS OR ? <4>          ...4 represents GARLIC.
  301.  
  302. SET 6 = (ONIONS OR GARLIC)       ...  Set 6 is now defined
  303.  
  304.  
  305. The symbols "<>" indicate that the enclosed character or word is
  306. typed, and then the enter key is pressed.  Note that a prompt at
  307. the bottom of the screen tells you what to do.
  308.  
  309. The search critera used in the search will be those defined by
  310. the last search set.  When the search is completed, the number of
  311. occurrences of each word and each search set are tabulated on the
  312. screen.  You might find it useful to define search sets that are
  313. not actually part of the final search criteria.  You can use this
  314. to find out how many records meet various search criteria without
  315. necessarily saving those records.
  316.  
  317. With practice, you will find that you can construct a sorted
  318. destination file by running more than one search.  For example,
  319. you could search for records containing
  320.  
  321.              AVOCADO AND (ONIONS OR GARLIC),
  322.  
  323. then conduct another search for
  324.  
  325.             AVOCADO AND NOT(ONIONS OR GARLIC).
  326.  
  327. Note that the two above sets are mutually exclusive, that is they
  328. do not share any records in common.  In combination, they include
  329. all recipes with AVOCADO.  By appending the second search to the
  330. end of the first search, you would have a file with avocado
  331. recipes sorted according to whether or not they contained onions
  332. or garlic.
  333.  
  334.  
  335. Destination File
  336. ----------------
  337.  
  338. Any valid text file name can be specified as the destination
  339. file, with the exception of subdirectories and paths.  For faster
  340. program execution, it is recommended that the destination file be
  341. on a different disk drive than the source files.
  342.  
  343.  
  344. For Fastest Performance
  345. -----------------------
  346.  
  347. If you have a RAM disk, conduct your search from source files in
  348. the RAM disk.
  349.  
  350.  
  351. Improvements to KWSEARCH
  352. ------------------------
  353.  
  354. KWSEARCH is being redesigned for easier use and higher
  355. performance.  A future version will provide more detailed search
  356. statistics.  Any comments you may have will be appreciated and
  357. will be considered for implementation.  Please send comments to:
  358.  
  359.  
  360.  
  361.          Geoplot Computer Projects
  362.          PO Box 46173, station G
  363.          Vancouver, BC  Canada  V6R 4G5
  364.